<template>
	<div>
		<p>从其他组件传过来的值： {{msg}}</p>
	</div>
</template>

<script>
	import bus from '../assets/js/eventBus.js'
	export default {
		data() {
			return {
				msg: "默认值",
			}
		},
		mounted() {
			var self = this;
			bus.$on("userData", function() {
				self.one();
			});
		},
		methods: {
			one: function() {
				console.log("222");
				this.msg = "222";
			}
		},
	}
	
</script>

<style>
</style>